JavaScript Grammar by Sidelnikov Greg

JavaScript Grammar by Sidelnikov Greg

Author:Sidelnikov, Greg [Sidelnikov, Greg]
Language: eng
Format: epub
Publisher: Learning Curve Books
Published: 2020-02-10T16:00:00+00:00


Good reasons to use .matchAll()

1. It can be more elegant when using with capture groups. A capture group is simply the part of regular expression with ( ) that extracts a pattern.

2. It returns an iterator instead of array. Iterators on their own are useful.

3. An iterator can be converted to an array using spread operator (...)

4. It avoids regular expressions with /g flag... useful when an unknown regular expression is retrieved from database or outside source and used together with the archaic RegEx object.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.